import {request} from "@/utils/request";
import {
  addLevelResponse,
  NursingLevelPageResponse,
  NursingLevelResponse,
  NursingLevelVo, NursingPlan, queryAllNursingPlansResponse
} from "@/pages/serve/plan/grade/model/NursingGradeModel";
import {NursingProjectListAllResult} from "@/pages/serve/plan/project/model/NursingProject";

//分页查询护理项目列表
export function searchNursingLevel(params) {
  return request.get<NursingLevelPageResponse>({
    url: '/nursingLevel/listByPage',
    params
  })
}

// //查询后的回显
// export function queryAllProject() {
//   return request.get<NursingProjectListAllResult>({
//     url: '/nursing/plan/list',
//   })
// }

//根据id查询
export function queryLevelById(id) {
  return request.get<NursingLevelResponse>({
    url: `nursingLevel/${id}`
  })
}

//删除
export function deleteLevel(id) {
  return request.delete<NursingLevelResponse>({
    url: `/nursingLevel/${id}`
  })
}

//查询所有护理计划
export function AllNursingPlans() {
  return request.get<queryAllNursingPlansResponse>({
    url: '/nursingLevel/listAllPlans'
  })
}

//新增护理等级
export function addNursingLevel(data) {
  return request.post<addLevelResponse>({
    url: '/nursingLevel',
    data
  })
}

//修改护理等级
export function updateNursingLevel(data) {
  return request.put<addLevelResponse>({
    url: '/nursingLevel',
    data
  })
}
